
--#include "data\functions\Boss\BossHomeCommon.lua" once


local npcId = 134
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]

t.main = function(sysarg)
	local sceneId = Actor.getSceneId( sysarg )
	local homeCfg = GetBossHomeCfgBySceneId( sceneId )
	local nextHomeIdx = 0
	if not homeCfg then
		nextHomeIdx = 1
	else
		nextHomeIdx = homeCfg.homeIdx + 1
	end

	local strCond = ""
	local nextHomeCfg = BossHomeConfig[nextHomeIdx]
	if not nextHomeCfg then
		return
	end

	local homeSts = GetBossHomeSts( sceneId )
	if homeSts == 0 then 			--BOSS之家家外
		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonEnter, "EnterBossHomeFromNpc" }		--{按钮;样式;按钮名;函数名;描述}
		CommonNpcDialog( sysarg, nextHomeCfg, 0, 0, Lang.ScriptTips.BossHomeDesc01, functions, NpcDialogType.GeneralNpcDlg )
	elseif homeSts == 1 then 		--BOSS之家首层
		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonExit, "QuitBossHomeFromNpc" }
		functions[2] = { Lang.ScriptTips.ButtonEnterNext, "NextBossHomeFromNpc" }
		CommonNpcDialog( sysarg, nextHomeCfg, 0, 0, Lang.ScriptTips.BossHomeDesc02, functions, NpcDialogType.GeneralNpcDlg )
	elseif homeSts == 2 then 		--BOSS之家内（非首层、顶层）
		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonExit, "QuitBossHomeFromNpc" }
		functions[2] = { Lang.ScriptTips.ButtonEnterNext, "NextBossHomeFromNpc" }
		functions[3] = { Lang.ScriptTips.ButtonEnterPriv, "PrivBossHomeFromNpc" }
		CommonNpcDialog( sysarg, nextHomeCfg, 0, 0, Lang.ScriptTips.BossHomeDesc02, functions, NpcDialogType.GeneralNpcDlg )
	elseif homeSts == 3 then 		--BOSS之家顶层
		local functions = {}
		functions[1] = { Lang.ScriptTips.ButtonExit, "QuitBossHomeFromNpc" }
		functions[2] = { Lang.ScriptTips.ButtonEnterPriv, "PrivBossHomeFromNpc" }		
		CommonNpcDialog( sysarg, nextHomeCfg, 0, 0, Lang.ScriptTips.BossHomeDesc03, functions, NpcDialogType.GeneralNpcDlg )
	end
	------------------
end

--进入BOSS之家
t.EnterBossHomeFromNpc = function ( sysarg )
	--print("EnterBossHomeFromNpc...")
	Actor.closeNPCDialog(sysarg)
	-- if 	Actor.checkActorLevel( sysarg, BossHomeFubenConfig.enterLevelLimit[2], BossHomeFubenConfig.enterLevelLimit[1] ) and
	--    	not Actor.checkActorLevel( sysarg, BossHomeFubenConfig.noEnterLevelLimit[2], BossHomeFubenConfig.noEnterLevelLimit[1] ) and
	-- 	IsOpenServerDayInRange( BossHomeFubenConfig.enterInOpenDays ) then
		
	-- 	EnterBossHomeFuben( sysarg )			--进入副本
	-- else
		EnterBossHome( sysarg, 0, 1 )			--从外部进入第一层场景
	--end
end

--返回上一层
t.PrivBossHomeFromNpc =  function ( sysarg )
	--print("PrivBossHomeFromNpc...")
	Actor.closeNPCDialog(sysarg)
	PrivBossHome( sysarg )
end

--进入下一层
t.NextBossHomeFromNpc = function ( sysarg )
	--print("NextBossHomeFromNpc...")
	Actor.closeNPCDialog(sysarg)
	NextBossHome( sysarg )
end

--退出BOSS之家
t.QuitBossHomeFromNpc = function ( sysarg )
	--print("QuitBossHomeFromNpc...")
	Actor.closeNPCDialog(sysarg)
	QuitBossHome( sysarg )
end


